package com.spider.silence.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author 夏茂轩
 * @package com.spider.silence.utils
 * @Date 2017/1/11 15:09
 */
public class CenterExecutorUtil {
    private static ExecutorService pool =  Executors.newFixedThreadPool(Integer.valueOf(PropertiesUtil.getVal("main.woker.size")));

    /**
     * @author 夏茂轩
     * @date 2017/1/11 15:13
     * @description 添加线程到线程池中
     * @param runnable
     */
    public synchronized static void  execute(Runnable runnable){
        pool.execute(runnable);
    }
}
